home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / opalpaint / opal_add_gradual_mosaic < prev    next >
Encoding:
Text File  |  1995-01-12  |  1.9 KB  |  71 lines

  1. /* 
  2.                           OPAL ADD GRADUAL MOSAIC
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.      Apply Mosaic Function To A Sequence Of Images Gradually Over Time
  7.                              Opal Paint Script
  8.  
  9.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  10. allow you to pass certain parameters to the external program you wish
  11. to use to convert the images from one format to another. You can pass
  12. five different strings from Batch Factory to the script by using the
  13. following commands:
  14.  
  15. $N = This will pass the current selected filename.
  16. $P = This will tell Batch Factory to ask for a path to save new frames to.
  17. $# = This will pass the current frame number in the script.
  18. $T = This will pass the total number of frames in the script.
  19. $A = This will pass an offset number to be used to save frames with.
  20.  
  21. NOTE: The following line is required to work as a Batch Factory Script:
  22.  
  23. PARSE=$N $P $# $A $T
  24.  
  25. */
  26.  
  27. options results
  28. call Locate_OpalPaint
  29. address "OpalPaint_Rexx"
  30.  
  31. arg InPic OutPic FrameNum AddNum TotalNum
  32. SaveNum = FrameNum + AddNum
  33.  
  34. if FrameNum = 1 then do
  35.     SaveSetUp
  36.         SetPrefs 1024
  37.         AskBool "Select Save Format You Wish To Use?\n\n        Select [OK] For IFF \n\n     Select [CANCEL] For JPEG"
  38.     if Result=0 then do
  39.         AskProp 1 100 84 "Enter JPEG Compression Value (1 - 100)!"
  40.         Format = JPEG Result
  41.         end
  42.     else
  43.         Format = IFF
  44.         Saver Format
  45.     ActivePot 1
  46.     end
  47.  
  48. Load InPic
  49. Num = ((FrameNum * 31)/(TotalNum))
  50. SetDrawMode 18 Num
  51. if FrameNum > 1 then Zap
  52.  
  53. if OutPic = "SAME" then
  54.     Save InPic
  55. else
  56.     Save OutPic""right(SaveNum,3,0)
  57. if FrameNum = TotalNum then do
  58.     RestoreSetUp
  59.     Key "AMIGA w"
  60.     address command "wait 1"
  61.     end
  62. exit
  63.  
  64. Locate_OpalPaint:
  65.     if (POS('OpalPaint_Rexx',SHOW('Ports')) = 0)
  66.     then do
  67.         address command 'run < nil: > nil: OpalPaint:OpalPaint -q'
  68.         address command 'wait 5'
  69.     end
  70. return
  71.